<ul>
	<?php foreach($rows_group as $row):?>
	<li><a href="<?php echo admin_url('module/assign').'?gid='.$row->group_id;?>"><?php echo $row->group_name;?></a></li>
	<?php endforeach;?>
</ul>


<?php if(isset($_GET['gid']) && $_GET['gid'] !=''):?>
<h1>Add Tour style</h1>

	<?php if($this->message->has('error')):?>
	<div class="error"><h2><?php echo $this->message->display();?></h2></div>
	<?php endif;?>
	
    <div class="tableout">
		<div class="title1">
            <div class="column" style="width:100%;">Add new tour:</div>
        </div>
        <?php 
        $attr = array(
        	'method'	=>	'post'
        );
        ?>
        
        <?php if(isset($_GET['id']) && $_GET['id'] != ''):?>
        <?php echo form_open(admin_url('module/assign'.(isset($_GET['gid']) ? '?gid='.$_GET['gid'].'&id='.$_GET['id'].'' : '')),$attr);?>
        <div style="width:100%; float:left;">
            <ul class="lineadd2">
                <li>
                    <span class="left">Module:</span>
                    <span class="right">
                        <select name="module" style="width:60%;">
                            <option value="">--Select module--</option>
                            <?php foreach($rows_module_none as $row):?>
                            <option <?php echo ($row_module->module_id == $row->id ? 'selected="selected"' : '')?> value="<?php echo $row->id;?>"><?php echo $row->title;?></option>
                            <?php endforeach;?>
                        </select>
                    </span>
                </li>
                <li>
                    <span class="left">Method:</span>
                    <span class="right"><input type="text" name="method" value="<?php echo (set_value('method') ? set_value('method') : $row_module->method);?>" style="width:60%;" /></span>
                </li>
                <li>
                    <span class="left">Status:</span>
                    <span class="right"><input <?php echo ($row_module->status == 'active' ? 'checked="checked"' : '');?> type="checkbox" name="status" value="active" /></span>
                </li>
            </ul>
            
            
        </div>

        <div class="bottomadd">	
        	<input type="hidden" name="id" value="" />
        	<input type="submit" name="" value="Back" class="btnsave" />
            <input type="button" name="" value="Clear" class="btnsave" />
        	<input type="submit" name="" value="Save & Continute" class="btnsave" />
        </div>
        <?php echo form_close();?>
        
        <?php else:?>
        <?php echo form_open(admin_url('module/assign'.(isset($_GET['gid']) ? '?gid='.$_GET['gid'].'' : '')),$attr);?>
        <div style="width:100%; float:left;">
            <ul class="lineadd2">
                <li>
                    <span class="left">Module:</span>
                    <span class="right">
                        <select name="module" style="width:60%;">
                            <option value="">--Select module--</option>
                            <?php foreach($rows_module_none as $row):?>
                            <option value="<?php echo $row->id;?>"><?php echo $row->title;?></option>
                            <?php endforeach;?>
                        </select>
                    </span>
                </li>
                <li>
                    <span class="left">Method:</span>
                    <span class="right"><input type="text" name="method" value="<?php echo set_value('title');?>" style="width:60%;" /></span>
                </li>
                <li>
                    <span class="left">Status:</span>
                    <span class="right"><input type="checkbox" name="status" value="active" /></span>
                </li>
            </ul>
            
            
        </div>

        <div class="bottomadd">	
        	<input type="hidden" name="id" value="" />
        	<input type="submit" name="" value="Back" class="btnsave" />
            <input type="button" name="" value="Clear" class="btnsave" />
        	<input type="submit" name="" value="Save & Continute" class="btnsave" />
        </div>
        <?php echo form_close();?>
        <?php endif;?>
        
    </div>
    
    
    <div class="tableout">
		<div class="title1">
        	<div class="column" style="width:2%;"><input type="checkbox" name="" value="" /></div>
            <div class="column" style="width:2%;">No</div>
            <div class="column" style="width:20%;">Title</div>
            <div class="column" style="width:20%;">Controller</div>
            <div class="column" style="width:24%;">Method</div>
            <div class="column" style="width:10%;">Date</div>
            <div class="column" style="width:16%;">Posted by</div>
            <div class="column" style="width:6%;">Status</div>
        </div>
        
        <?php foreach($rows_module as $k => $rows):?>
        <div class="linecate2">
        	<div class="column" style="width:2%;"><input type="checkbox" name="" value="" /></div>
            <div class="column" style="width:2%;"><?php echo ($k+1);?></div>
            <div class="column" style="width:20%;" onmouseover="Hovercat('<?php echo ($k+1);?>')" onmouseout="Outcat('<?php echo ($k+1);?>')">
            	<a href="javascript:;" class="art"><?php echo $rows->title;?></a><br />
                <div class="action" id="neocat-<?php echo ($k+1);?>">
                    <img src="<?php echo img_link('edit.gif','admin');?>" /><a href="<?php echo admin_url('module/assign?gid='.$_GET['gid'].'&id='.$rows->per_id);?>" >Edit</a><img src="<?php echo img_link('delete.gif','admin');?>" /><a href="<?php echo admin_url('module/delete?gid='.$_GET['gid'].'&id='.$rows->per_id);?>"><font color="#be0000">Delete</font></a>
                </div>
            </div>
            <div class="column" style="width:20%;">
            	<a href="javascript:;" class="art"><?php echo $rows->name;?></a>
            </div>
            <div class="column" style="width:24%;">
            	<?php echo $rows->method;?>
            </div>
            <div class="column" style="width:10%;"><font class="date">09-11-2010</font></div>
            <div class="column" style="width:16%;"><font class="date">Nguyễn Minh Hà</font></div>
            <div class="column" style="width:6%;"><a href="#"><img src="<?php echo img_link((($rows->status == 'active') ? 'active.png' : 'pending.png'),'admin')?>" class="icon png" title="Pending" alt="Pending" /></a></div>
        </div>
        <?php endforeach;?>
        <div class="bottom1">
        	<div class="column" style="width:2%;"><input type="checkbox" name="" value="" /></div>
            <div class="column" style="width:50%;">
            	<select style="width:130px;">
                    <option value="1">Action</option>
                    <option value="2">Edit</option>
                    <option value="3">Delete</option>
                </select>
                <input type="submit" name="" value="Apply" class="btn" />
            </div>
            <span class="right1">
                <div class="pagination">
                    <ul>
                        <li><a href="#" class="prevnext disablelink">« Prev</a></li>
                        <li><a href="#" class="currentpage">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a>...</li>
                        <li><a href="#">15</a></li>
                        <li><a href="#">16</a></li>
                        <li><a href="#" class="prevnext">Next »</a></li>
                    </ul>
                </div>
            </span>
        </div>
        
    </div>
    
 <?php endif;?>